cmake_minimum_required(VERSION 3.15)

# Find required packages
find_package(Threads REQUIRED)

# Build write example
add_executable(write_example write_example.cpp)

target_link_libraries(write_example
    PRIVATE
        kwdb_sdk
)

# Install example to bin/
install(TARGETS write_example DESTINATION bin)

# Build streaming example
add_executable(streaming_example streaming_example.cpp)
target_link_libraries(streaming_example
    PRIVATE
        kwdb_sdk
        Threads::Threads
)
install(TARGETS streaming_example DESTINATION bin)

# Build Agent Mode example
# Demonstrates: Business App -> Agent (HTTP) -> KWDB (UDS)
add_executable(agent_example agent_example.cpp)
target_link_libraries(agent_example
    PRIVATE
        kwdb_sdk
        Threads::Threads
)
install(TARGETS agent_example DESTINATION bin)

# Build ILP (InfluxDB Line Protocol) example
# Demonstrates: HTTP-based ingestion with ILP format and GZIP compression
add_executable(ilp_example ilp_example.cpp)
target_link_libraries(ilp_example
    PRIVATE
        kwdb_sdk
        Threads::Threads
        z  # For GZIP compression
)
install(TARGETS ilp_example DESTINATION bin)